﻿using System;
using System.Collections.Generic;
using FrankJie.Model;
namespace FrankJie.IDAL
{
	/// <summary>
	/// 文章接口
	/// </summary>
	public interface IPost
	{
		/// <summary>
		/// 增加一篇文章
		/// </summary>
		/// <param name="postInfo">文章实体</param>
		/// <returns>返回文章ID</returns>
		int Add(PostInfo postInfo);

		/// <summary>
		/// 更新一篇文章
		/// </summary>
        /// <param name="postInfo">文章实体</param>
		/// <returns>返回是否成功</returns>
		bool Update(PostInfo postInfo);

        /// <summary>
        /// 更改文章状态
        /// </summary>
        /// <param name="id">文章id</param>
        /// <param name="Status">状态 PostStatus枚举</param>
        /// <returns>返回是否成功</returns>
        bool UpdateStatus(int id,int status);

		/// <summary>
		/// 删除一篇文章
		/// </summary>
        /// <param name="id">文章id</param>
        /// <returns>返回是否成功</returns>
		bool Delete(int id);

		/// <summary>
		/// 根据文章id获取文章
		/// </summary>
		/// <param name="id">文章id</param>
        /// <returns>返回文章实体</returns>
		PostInfo GetPostById(int id);

        /// <summary>
        /// 获取文章列表
        /// </summary>
        /// <returns>返回文章集合</returns>
        List<PostInfo> GetList();

        /// <summary>
        /// 增加浏览数
        /// </summary>
        /// <param name="dic"></param>
        void AddViewCount(Dictionary<int,int> dic);
	} 
}
